﻿<!DOCTYPE html>
<!--承包商入场工具管理销核-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    <div id="app" v-cloak  class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="140px"
                 size="mini">
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.CarryingToolName" autocomplete="off" size="mini" >
                                <template slot="prepend">
                                    {{ContractorAdmissionTool.CarryingToolName+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <el-form-item :label="ContractorAdmissionTool.CarryingToolQuantity+mark.m" class="inputTextarea">
                        <!-- 弹出页的其它不能成组的控件添加class="inputTextarea"，达到label与input、select等控件的label对齐的目的 -->
                        <el-input-number v-model="Form.CarryingToolQuantity" @change="handleChange" :min="1"></el-input-number>
                    </el-form-item>
                </el-col>

                <el-col :span="11" >
                    <el-form-item :label="ContractorAdmissionTool.IsConsumables+mark.m" prop="IsConsumables">
                        <el-radio-group v-model="Form.IsConsumables" style="margin-top:5px">
                            <el-radio v-for="item in IsConsumables" :label="item.value" :value="item.key" >{{item.value}}</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm()">{{col.btnSave}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                //业务表单内容
                Form: {
              
                    CarryingToolName: '',//携带工具名称
                    CarryingToolQuantity: '',//入场携带工具数量
                    IsConsumables: '',//是否为消耗品
                },
                IsConsumables: [],

                //表单验证
                rules: {
                    PersonnelName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 5), message: verification.StringLengthAtoB.m.format(2, 5), trigger: 'blur' }
                    ],
                    ContractorName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleChange: function (value) {
                    console.log(value);
                },
                handleChangeA: function (value) {
                    console.log(value);
                },
                //提交数据
                onSubmitForm: function () {

                    parent.app.Form.CarryingToolList.push({
                        CarryingToolName: this.Form.CarryingToolName,
                        CarryingToolQuantity: this.Form.CarryingToolQuantity,
                        IsConsumables: this.Form.IsConsumables,
                        id: Mock.Random.id(),
                        OutCarryingQuantity:0,
                        });
                        parent.app.ListItem.dialogVisible = false;

                },
             
            },
            mounted: function () {
                this.IsConsumables = getDicData('50');

            }
        });
    </script>
</body>

</html>